s = input()
ans = 0
for i in range(len(s)-1):
if s[i] == 'V' and s[i+1] == 'K':
ans += 1
if s[:2] == 'KK' or s[-2:] == 'VV' or s.find('VVV') != -1 or s.find('KKK') != -1:
ans += 1
print(ans)
505B - Mr Kitayuta's Colorful Graph | 1324D - Pair of Topics |
157B - Trace | 34C - Page Numbers |
279A - Point on Spiral | 1294D - MEX maximizing |
447A - DZY Loves Hash | 23B - Party |
63D - Dividing Island | 1203E - Boxers |
1547F - Array Stabilization (GCD version) | 358A - Dima and Continuous Line |
1385C - Make It Good | 651A - Joysticks |
1474D - Cleaning | 1588A - Two Arrays |
816A - Karen and Morning | 9D - How many trees |
918B - Radio Station | 15A - Cottage Village |
1737B - Ela's Fitness and the Luxury Number | 1425H - Huge Boxes of Animal Toys |
1737A - Ela Sorting Books | 768C - Jon Snow and his Favourite Number |
1006C - Three Parts of the Array | 81A - Plug-in |
276C - Little Girl and Maximum Sum | 1738D - Permutation Addicts |
1348B - Phoenix and Beauty | 186A - Comparing Strings |